feat(init): add --template option, Issue: #1340#1342
Merged
Conversation
Signed-off-by: Jiaqi Zhou <1405758738@qq.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Signed-off-by: Jiaqi Zhou <1405758738@qq.com>
Signed-off-by: Jiaqi Zhou <1405758738@qq.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a --template option to the init command that allows users to initialize a Libra repository from a specified template directory. If no template is specified, the default initialization behavior is maintained.
- Adds
--template <template-directory>parameter to theinitcommand - Implements template copying functionality with recursive directory support
- Adds comprehensive test coverage for template functionality including error cases
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| libra/src/command/init.rs | Implements the core template functionality with copy_template function and template parameter handling |
| libra/tests/command/init_test.rs | Adds comprehensive test cases for template functionality and updates existing tests with new parameter |
| libra/tests/command/checkout_test.rs | Updates test to include the new template parameter |
| libra/src/utils/test.rs | Updates utility function to include the new template parameter |
| libra/src/command/clone.rs | Updates clone command to include the new template parameter |
| aria/contents/docs/libra/command/init/index.mdx | Documents the new template option |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
genedna
approved these changes
Aug 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
功能简介
在
init命令中新增--template <template-directory>参数,用于从指定模板目录初始化 Libra 仓库。如果未指定,仍使用默认模板。
修改内容
init命令逻辑,支持--template参数init命令文档测试情况
cargo test运行所有单元测试及集成测试,确保功能正常Issue
#1340